import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { AtTabBar } from 'taro-ui'
import './tabBar.scss'

export default class SegmentedControl extends Component{
    config={
        navigationBarTitleText: '标签栏'
    }
    constructor(){
        super(...arguments)
        this.state={
            current:0
        }
    }
    handleClick(value){
        this.setState({
            current:value
        })
    }
    render(){
        return(
            <View>
                <AtTabBar
                fixed
                backgroundColor='#f00'
                color='#ff0'
                tabList={[
                    {title:'待办事项',text:'o',max:'99'},
                    {title:'通讯录', iconType:'camera', dot:true},
                    {title:'文件夹',text:'100',max:'99',color:'#fff'}
                ]
                }
                onClick={this.handleClick.bind(this)}
                current={this.state.current}
                />

            </View>
        )
    }
}